warning_printf(my_file, "Warning: This blue door at seg %i, is different than the one at seg %i, side %i\n", Walls[i].segnum, blue_segnum, blue_sidenum);
blue_count++;
}
}
}
if (Walls[i].keys & KEY_RED) {
fprintf(my_file, "Wall %i (seg=%i, side=%i) is keyed to the red key.\n", i, Walls[i].segnum, Walls[i].sidenum);
warning_printf(my_file, "Warning: This gold door at seg %i, is different than the one at seg %i, side %i\n", Walls[i].segnum, gold_segnum, gold_sidenum);
gold_count++;
}
}
}
}
if (blue_count > 1)
warning_printf(my_file, "Warning: %i doors are keyed to the blue key.\n", blue_count);
if (red_count > 1)
warning_printf(my_file, "Warning: %i doors are keyed to the red key.\n", red_count);
if (gold_count > 1)
warning_printf(my_file, "Warning: %i doors are keyed to the gold key.\n", gold_count);
red_count2 = 0;
blue_count2 = 0;
gold_count2 = 0;
for (i=0; i<=Highest_object_index; i++) {
if (Objects[i].type == OBJ_POWERUP)
if (Objects[i].id == POW_KEY_BLUE) {
fprintf(my_file, "The BLUE key is object %i in segment %i\n", i, Objects[i].segnum);
blue_count2++;
}
if (Objects[i].type == OBJ_POWERUP)
if (Objects[i].id == POW_KEY_RED) {
fprintf(my_file, "The RED key is object %i in segment %i\n", i, Objects[i].segnum);
red_count2++;
}
if (Objects[i].type == OBJ_POWERUP)
if (Objects[i].id == POW_KEY_GOLD) {
fprintf(my_file, "The GOLD key is object %i in segment %i\n", i, Objects[i].segnum);
gold_count2++;
}
if (Objects[i].contains_count) {
if (Objects[i].contains_type == OBJ_POWERUP) {
switch (Objects[i].contains_id) {
case POW_KEY_BLUE:
fprintf(my_file, "The BLUE key is contained in object %i (a %s %s) in segment %i\n", i, Object_type_names[Objects[i].type], Robot_names[Objects[i].id], Objects[i].segnum);
blue_count2 += Objects[i].contains_count;
break;
case POW_KEY_GOLD:
fprintf(my_file, "The GOLD key is contained in object %i (a %s %s) in segment %i\n", i, Object_type_names[Objects[i].type], Robot_names[Objects[i].id], Objects[i].segnum);
gold_count2 += Objects[i].contains_count;
break;
case POW_KEY_RED:
fprintf(my_file, "The RED key is contained in object %i (a %s %s) in segment %i\n", i, Object_type_names[Objects[i].type], Robot_names[Objects[i].id], Objects[i].segnum);
red_count2 += Objects[i].contains_count;
break;
default:
break;
}
}
}
}
if (blue_count)
if (blue_count2 == 0)
err_printf(my_file, "Error: There is a door keyed to the blue key, but no blue key!\n");
if (red_count)
if (red_count2 == 0)
err_printf(my_file, "Error: There is a door keyed to the red key, but no red key!\n");
if (gold_count)
if (gold_count2 == 0)
err_printf(my_file, "Error: There is a door keyed to the gold key, but no gold key!\n");
if (blue_count2 > 1)
err_printf(my_file, "Error: There are %i blue keys!\n", blue_count2);
if (red_count2 > 1)
err_printf(my_file, "Error: There are %i red keys!\n", red_count2);
if (gold_count2 > 1)
err_printf(my_file, "Error: There are %i gold keys!\n", gold_count2);
if (Segments[Station[i].segnum].special != Station[i].Type)
err_printf(my_file, "Error: Conflicting data: Segment %i has special type %i (%s), expected to be %i\n", Station[i].segnum, Segments[Station[i].segnum].special, Special_names[Segments[Station[i].segnum].special], Station[i].Type);
if (Station[fuelcen_num].Type != SEGMENT_IS_ROBOTMAKER)
err_printf(my_file, "Error: Matcen %i corresponds to Station %i, which has type %i (%s).\n", i, fuelcen_num, Station[fuelcen_num].Type, Special_names[Station[fuelcen_num].Type]);
segnum = Station[fuelcen_num].segnum;
// Find trigger for this materialization center.
for (j=0; j<Num_triggers; j++) {
if (Triggers[j].flags & TRIGGER_MATCEN) {
for (k=0; k<Triggers[j].num_links; k++)
if (Triggers[j].seg[k] == segnum) {
fprintf(my_file, "Trigger = %2i ", j );
trigger_count++;
}
}
}
fprintf(my_file, "\n");
if (trigger_count == 0)
err_printf(my_file, "Error: Matcen %i in segment %i has no trigger!\n", i, segnum);
if (Segments[segnum].sides[sidenum].wall_num != i)
err_printf(my_file, "Error: Wall %i points at segment %i, side %i, but that segment doesn't point back (it's wall_num = %i)\n", i, segnum, sidenum, Segments[segnum].sides[sidenum].wall_num);
}
for (i=0; i<MAX_WALLS; i++)
wall_flags[i] = 0;
for (i=0; i<=Highest_segment_index; i++) {
segment *segp = &Segments[i];
for (j=0; j<MAX_SIDES_PER_SEGMENT; j++) {
side *sidep = &segp->sides[j];
if (sidep->wall_num != -1)
if (wall_flags[sidep->wall_num])
err_printf(my_file, "Error: Wall %i appears in two or more segments, including segment %i, side %i.\n", sidep->wall_num, i, j);
void determine_used_textures_level(int load_level_flag, int shareware_flag, int level_num, int *tmap_buf, int *wall_buf, byte *level_tmap_buf, int max_tmap)
{
int segnum, sidenum;
int i, j;
for (i=0; i<max_tmap; i++)
tmap_buf[i] = 0;
if (load_level_flag) {
if (shareware_flag)
load_level(Shareware_level_names[level_num]);
else
load_level(Registered_level_names[level_num]);
}
for (segnum=0; segnum<=Highest_segment_index; segnum++) {
segment *segp = &Segments[segnum];
for (sidenum=0; sidenum<MAX_SIDES_PER_SEGMENT; sidenum++) {